#pragma once
#include "hashpackage.h"

template <class K, class Hash = HashFunc<K>>
class unordset
{
	struct SetOfK
	{
		const K& operator()(const K& key)
		{
			return key;
		}
	};

	
public:
	typedef typename HashBucket<K, K, SetOfK, Hash>::const_iterator iterator;
	typedef typename HashBucket<K, K, SetOfK, Hash>::const_iterator const_iterator;
	const_iterator begin() const
	{
		return _ht.begin();
	}

	const_iterator end() const
	{
		return _ht.end();
	}

	std::pair<const_iterator, bool> insert(const K& key)
	{
		auto ret = _ht.insert(key);
		return std::pair<const_iterator, bool>(const_iterator(ret.first._node,
			ret.first._pht, ret.first._hashi), ret.second);
	}

	iterator find(const K& key)
	{
		return _ht.find(key);
	}

	bool erase(const K& key)
	{
		return _ht.erase(key);
	}

private:
	HashBucket<K, K, SetOfK, Hash> _ht;
};